/**
 * 
 */
package de.cbf.cam.dsa.model.prerequisites;

import java.util.List;

import de.cbf.cam.dsa.model.entities.BattleChar;
import de.cbf.cam.dsa.model.entities.OneNPC;
import de.cbf.cam.dsa.model.entities.SF;

/**
 * @author Nebelritter
 *
 */
public class SfPrereq extends Prereq {

	/**
	 * @uml.property  name="sfName"
	 */
	protected String sfName;
	/**
	 * 
	 */
	public SfPrereq(String sfName) {
		this.sfName = sfName;
	}

	/* (non-Javadoc)
	 * @see de.cbf.cam.dsa.model.prerequisites.Prereq#testChracter(de.cbf.cam.dsa.model.entities.BattleChar)
	 */
	@Override
	public boolean characterMeetsPrereq(BattleChar battleCharacter) {
		return characterMeetsPrereq(battleCharacter.getCharacter());
	}
	@Override
	public boolean characterMeetsPrereq(OneNPC character) {
		List<SF> sfs = character.getSFs();
		for(int i = 0;i<sfs.size();i++){
			SF sf = sfs.get(i);
			if(sf.getName().equals(sfName)){
				return true;
			}
		}
		return false;
	}

	/**
	 * @return
	 * @uml.property  name="sfName"
	 */
	public String getSfName() {
		return sfName;
	}

	/**
	 * @param sfName
	 * @uml.property  name="sfName"
	 */
	public void setSfName(String sfName) {
		this.sfName = sfName;
	}

	

}
